package com.sg.controller.pbff;

import com.sg.service.biz.pbff.PowerService;
import com.sg.dto.biz.pbff.req.*;
import com.sg.dto.biz.pbff.res.*;
import com.sg.common.ro.OkrResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author ：
 * @version 1.0
 * @date ：
 */
@Api(value = "Power", tags = {"Power"})
@RestController
// @RequestMapping("/poms/power/")
public class PowerController {
    @Autowired
    PowerService powerService;

    /**
     * B1-2查询权限列表（平台）
     * gen by moon at 8/10/2022, 3:40:27 AM
     */
    @PostMapping("/oms/platform/power/queryPowerList")
    @ApiOperation(value = "B1-2查询权限列表（平台）", response = OkrResult.class)
    public OkrResult<BffQueryPowerListRespDto> queryPowerList(@RequestBody(required = false) @Validated BffQueryPowerListReqDto reqDTO) {
        return OkrResult.success(powerService.queryPowerList(reqDTO));
    }

    /**
     * B1-2存档权限（平台）
     * gen by moon at 8/31/2022, 7:28:46 PM
     */
    @PostMapping("/oms/platform/power/archivePower")
    @ApiOperation(value = "B1-2存档权限（平台）", response = OkrResult.class)
    public OkrResult<BffArchivePowerRespDto> archivePower(@RequestBody(required = false) @Validated BffArchivePowerReqDto reqDTO) {
        return OkrResult.success(powerService.archivePower(reqDTO));
    }

    /**
     * B1-2修改权限（平台）
     * gen by moon at 8/10/2022, 3:40:31 AM
     */
    @PostMapping("/oms/platform/power/updatePower")
    @ApiOperation(value = "B1-2修改权限（平台）", response = OkrResult.class)
    public OkrResult<BffUpdatePowerRespDto> updatePower(@RequestBody(required = false) @Validated BffUpdatePowerReqDto reqDTO) {
        return OkrResult.success(powerService.updatePower(reqDTO));
    }

    /**
     * B1-2新增权限（平台）
     * gen by moon at 11/9/2022, 9:14:02 PM
     */
    @PostMapping("/oms/platform/power/addPower")
    @ApiOperation(value = "B1-2新增权限（平台）", response = OkrResult.class)
    public OkrResult<BffAddPowerRespDto> addPower(@RequestBody(required = false) @Validated BffAddPowerReqDto reqDTO) {
        return OkrResult.success(powerService.addPower(reqDTO));
    }

    /**
     * B1-2查询权限详情（平台）
     * gen by moon at 8/10/2022, 3:40:29 AM
     */
    @PostMapping("/oms/platform/power/queryPowerDetail")
    @ApiOperation(value = "B1-2查询权限详情（平台）", response = OkrResult.class)
    public OkrResult<BffQueryPowerDetailRespDto> queryPowerDetail(@RequestBody(required = false) @Validated BffQueryPowerDetailReqDto reqDTO) {
        return OkrResult.success(powerService.queryPowerDetail(reqDTO));
    }

    /**
     * B1-2删除权限（平台）
     * gen by moon at 11/8/2022, 7:49:58 PM
     */
    @PostMapping("/oms/platform/mgt/power/deletePower")
    @ApiOperation(value = "B1-2删除权限（平台）", response = OkrResult.class)
    public OkrResult<BffDeletePowerRespDto> deletePower(@RequestBody(required = false) @Validated BffDeletePowerReqDto reqDTO) {
        return OkrResult.success(powerService.deletePower(reqDTO));
    }

}

